#!/usr/bin/env python
# -*- coding: utf-8 -*-



class ReportMgr:
    def __init__(self, app, session):
        self.app = app
        self.session = session
        self.app.logger.warning(f'{self.__class__}: method __init__() is empty')


    def destroy(self):
        self.session = None
        self.app = None
        


    def __del__(self):
        self.destroy()


    def get_reports(self):
        return {
            "code": 200,
            "content": {
                "reports": [
                    {
                        "id": 111111, 
                        "name": "测试报告1", 
                        "owner": "admin", 
                        "testcase": "基础UI测试", 
                        "device": "测试设备1", 
                        "created": "2023-10-01", 
                        "status": "通过",
                    },
                    {
                        "id": 222222, 
                        "name": "性能测试报告", 
                        "owner": "tester", 
                        "testcase": "性能测试", 
                        "device": "OpenHarmony设备", 
                        "created": "2023-10-05", 
                        "status": "失败",
                    },
                    {
                        "id": 333333, 
                        "name": "兼容性测试报告", 
                        "owner": "admin", 
                        "testcase": "兼容性测试", 
                        "device": "测试设备2", 
                        "created": "2023-09-20", 
                        "status": "部分通过",
                    },
                ],
            },
        }
    

    def open_report(self, report_id):
        return { "code": 200, "content": {} }


    def export_reports(self, reports):
        return { "code": 200, "content": {} }


    def delete_reports(self, reports):
        return { "code": 200, "content": {} }